Introduction

I wanted to try working with map data in R.

Because my primary areas of interest are in healthcare and public health, I thought it would be interesting to work with selected measures from the 2019 County Health Rankings from the Robert Wood Johnson Foundation. You can find the data and read more information about its sources at this site: https://www.countyhealthrankings.org/.

In this analysis I have chosen to examine the following measures: Poor or Fair Health, Adult Obesity, Adult Smoking, Physical Inactivity and Uninsured.

Data visualization was performed using urbnmapr, ggplot2 and plotly.

First we map the percentage of people in each county who are in poor to fair health using the urbnmapr package. I chose this package because it allows you to make nice maps quite easily using shapefiles from the US Census Bureau. You can find more information about this package on their GitHub site: https://github.com/UrbanInstitute/urbnmapr.

Map 1: Poor or fair health percentage by county

We can see there is quite a bit of variation in this measure throughout the US. Next we map the percentage of adults who smoke.

Map 2: Adult smoking percentage by county

These two maps look remarkably similar (not too surprising given the well known health effects of smoking). There are some differences too if you look closely. Lets look at this data a different way. The next plot is interactive, so you can hover over a point to display the county and state.

Plot 1: Smoking and poor or fair health correlation by county

It does look like there’s a pretty strong correlation, but some counties have a very high percentage of poor or fair health and a medium percentage of adult smoking. Many of those counties are close to the the Mexican border. Look again at Map 1, and notice the amount of orange and red in this region compared to Map 2.

Another interesting insight is that there is a relatively large percentage of smokers in Alaska.

Next, we’ll look at a map of adult obesity rates.

Map 3: Adult obesity percentage by county

There is a lot of orange and yellow on the above map! It is well known that obesity is related to exercise. Let’s look at rates of physical inactivity to see if the pattern is similar.

Map 4: Physical inactivity percentage by county

As we did with smoking and health, we can plot adult obesity against physical inactivity to look for possible correlation.

Plots 2 and 3: Physical inactivity and adult obesity correlation by county

Here the correlation is a little less strong. Clearly factors other than lack of physical activity contribute to obesity rates.

It kind of looks like it may not be quite linear. Let’s examine a different type of fit, LOESS.

It looks like the obesity percentage kind of levels off as physical inactivity rates increase. We could do further analysis of this, but let’s leave that for another time and explore some more measures from the County Health Rankings.

Next we will look at the percentage of people who are uninsured.


Map 5: Uninsured percentage by county

Wow, it looks like really high percentages of the population are uninsured in counties in Texas, Alaska and Oklahoma! A little bit of internet searching turns up some similar findings, especially about Texas. According to news reports, the rate of uninsured people in Texas is almost double the national average. And the last couple of years, it has been increasing.

https://www.dallasnews.com/business/health-care/2019/09/10/here-s-how-many-texans-don-t-have-health-insurance-according-to-new-census-data/

Let’s look at the percentage of uninsured people at the state level.


Map 6: Uninsured percentage by state

I used a slightly different color palette for the state map, because I wanted to put labels on the states.

We can view states with the highest percentages of uninsured people in descending order:
State Uninsured
Texas 0.1856367
Oklahoma 0.1598517
Alaska 0.1551729
Florida 0.1535173
Georgia 0.1488511
Mississippi 0.1397983

On the county map, it kind of looks like Alaska would be higher than Oklahoma, because it has more yellow. However, when the data are aggregated at state level, it is clear that Oklahoma has more uninsured people than Alaska. This is because the population of Alaska is concentrated in a small part of the state. The parts of Alaska that are yellow and orange have a very low population density.

Much more insight can be gleaned from this dataset, but that is enough for today. It didn’t take long at all to learn how to use the urbnmapr package. I learned a lot while working on this project. We will explore more data from the County Health Rankings at a later time. Thank you for reading.